/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 石方旭
 * Date: 2022-03-19
 * Time: 13:27
 */
public class TestDemo {

    public static int getBitNum(int n) {
        int count =0;
            while(n!=0) {
             ++count;
             n=n&(n-1);
            }
        return count;
    }
    public static void main(String[] args) {
        System.out.println(getBitNum(-1));
    }




}
